import request from '@/utils/request'

// 查询区域列表
export function listArea(query) {
  return request({
    url: '/configureSystem/varea/list',
    method: 'get',
    params: query
  })
}

// 查询区域详细
export function getArea(areaId) {
  return request({
    url: '/configureSystem/varea/' + areaId,
    method: 'get'
  })
}

// 查询区域下拉树结构  -----角色vue页面中使用的
export function treeareaselect() {
  return request({
    url: '/configureSystem/varea/treeselect',
    method: 'get'
  })
}


// 查询区域下拉树结构查询
export function treeselect() {
  return request({
    url: '/configureSystem/varea/treeselect',
    method: 'get'
  })
}

// 查询区域下拉树结构----组织厂站中查询，根据用户角色来查询
export function treeselectByuserRole() {
  return request({
    url: '/configureSystem/varea/treeselectByuserRole',
    method: 'get'
  })
}



// 根据角色ID查询区域树结构
export function roleAreaTreeselect(roleId) {
  return request({
    url: '/configureSystem/varea/roleAreaTreeselect/' + roleId,
    method: 'get'
  })
}

// 新增区域
export function addArea(data) {
  return request({
    url: '/configureSystem/varea',
    method: 'post',
    data: data
  })
}

// 修改区域
export function updateArea(data) {
  return request({
    url: '/configureSystem/varea',
    method: 'put',
    data: data
  })
}

// 删除区域
export function delArea(areaId) {
  return request({
    url: '/configureSystem/varea' + areaId,
    method: 'delete'
  })
}